package co.edu.usbcali.hibernate.modelo;

import java.util.Date;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * VacunasMascotas entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "VACUNAS_MASCOTAS", schema = "ANDRIWS")
public class VacunasMascotas implements java.io.Serializable {

	// Fields

	private VacunasMascotasId id;
	private Mascotas mascotas;
	private Vacunas vacunas;
	private Date vacmasFecha;

	// Constructors

	/** default constructor */
	public VacunasMascotas() {
	}

	/** full constructor */
	public VacunasMascotas(VacunasMascotasId id, Mascotas mascotas,
			Vacunas vacunas, Date vacmasFecha) {
		this.id = id;
		this.mascotas = mascotas;
		this.vacunas = vacunas;
		this.vacmasFecha = vacmasFecha;
	}

	// Property accessors
	@EmbeddedId
	@AttributeOverrides( {
			@AttributeOverride(name = "masCodigo", column = @Column(name = "MAS_CODIGO", nullable = false, precision = 10, scale = 0)),
			@AttributeOverride(name = "vacCodigo", column = @Column(name = "VAC_CODIGO", nullable = false, precision = 10, scale = 0)) })
	public VacunasMascotasId getId() {
		return this.id;
	}

	public void setId(VacunasMascotasId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MAS_CODIGO", nullable = false, insertable = false, updatable = false)
	public Mascotas getMascotas() {
		return this.mascotas;
	}

	public void setMascotas(Mascotas mascotas) {
		this.mascotas = mascotas;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "VAC_CODIGO", nullable = false, insertable = false, updatable = false)
	public Vacunas getVacunas() {
		return this.vacunas;
	}

	public void setVacunas(Vacunas vacunas) {
		this.vacunas = vacunas;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "VACMAS_FECHA", nullable = false, length = 7)
	public Date getVacmasFecha() {
		return this.vacmasFecha;
	}

	public void setVacmasFecha(Date vacmasFecha) {
		this.vacmasFecha = vacmasFecha;
	}

}